from impala.dbapi import connect

def create_conn():
    return connect(host='master', port=10000,auth_mechanism='NOSASL')

def create_table(conn, db_name):
    cursor = conn.cursor()
    i = cursor.execute('create database ' + db_name)
    if i is None:
        print('创建数据库'+db_name+'成功，无返回值！')

if __name__ == '__main__':
    db_name = 'userdb1'
    conn = create_conn()
    create_table(conn, db_name)